import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:im_flutter_sdk/im_flutter_sdk.dart';
import 'package:just_audio/just_audio.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

import 'model.dart';

class ChatMessageListState {

  RefreshController refreshController = RefreshController(initialRefresh: false);

  final ScrollController scrollController = ScrollController();
  /// 消息模型
  var model = <ChatModel>[].obs;
  /// 音频播放器
  final player = AudioPlayer();

  /// taf
   String tag = 'ChatMessageListLogic';
  ChatMessageListState() {
    ///Initialize variables
  }
}


extension EMMessageExtension on EMMessage {

  static ChatMessageEntity? model;

  ChatMessageEntity get chatModel => ChatMessageEntity();

  set chatModel(ChatMessageEntity value) {
    model = value;
  } // 添加一个名为age的可写属性
}


class ChatModel {
  ChatMessageEntity? serverMeg;
  EMConversation? superXin;
  EMMessage? xinMsg;
  ChatModel({this.serverMeg,this.superXin,this.xinMsg});
}